<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <script type="text/javascript" src="js/jquery-1.12.4.js"></script>
    <script type="text/javascript" src="js/jquery.cookie.js"></script>
    <script type="text/javascript">
        $(function () {
            var $hasread = $.cookie('hasread');
            
            //判断是否存在cookie
            if ($hasread == undefined) {
                $('.pop_con').show();

            }

            //用户点击时  存 cookie 
            $('#userread').click(function () {
                $.cookie('hasread', 'read', {
                    expires: 7,
                    path: '/'
                });
                $('.pop_con').hide();
            });


        });
    </script>
    <style type="text/css">
        .pop_con {
            display: none;
        }

        .pop {
            position: fixed;
            width: 500px;
            height: 300px;
            background-color: #ffffff;
            border: 3px solid #000000;

            left: 50%;
            top: 50%;

            margin-left: -250px;
            margin-top: -150px;
            z-index: 9999;

        }


        .mask {
            position: fixed;
            width: 100%;
            height: 100%;
            background-color: #000;
            opacity: 0.3;
            filter: alpha(opacity=30);
            left: 0;
            top: 0;
            z-index: 9998;
        }

        .close {
            float: right;
            font-size: 30px;
        }
    </style>
    <title>Document</title>
</head>

<body>

    <div class="pop_con">
        <div class="pop">
            亲!本网站最近优惠,请强力关注!
            <!-- <a href="#" class="close" id="close">×</a> -->
            <a href="javascript:;" id="userread">朕知道了!</a>
        </div>
        <div class="mask"></div>

    </div>

    <h1>网站内容</h1>


</body>

</html>